﻿using System;
using System.ComponentModel;
using RaytracerLib.MathLib;
using RaytracerLib.Attenuations;
using RaytracerLib;
using System.Drawing;
using RaytracerLib.UVMappers;

namespace Raytracer.PropertyGridDecorators
{
    public abstract class UVMapperProperties
    {
        public abstract UVMapper GetMapper();
    }

    public class UVConicalMapperProperties : UVMapperProperties
    {
        private ConicalUVMapper m_mapper;

        public override UVMapper GetMapper()
        {
            return m_mapper;
        }

        public UVConicalMapperProperties(ConicalUVMapper a_mapper)
        {
            m_mapper = a_mapper;
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double Radius
        {
            get
            {
                return m_mapper.Radius;
            }
            set
            {
                m_mapper.Radius = value;
            }
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double Height
        {
            get
            {
                return m_mapper.Height;
            }
            set
            {
                m_mapper.Height = value;
            }
        }
    }

    public class UVToroidalMapperProperties : UVMapperProperties
    {
        private TorodidalUVMapper m_mapper;

        public override UVMapper GetMapper()
        {
            return m_mapper;
        }

        public UVToroidalMapperProperties(TorodidalUVMapper a_mapper)
        {
            m_mapper = a_mapper;
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double BigRadius
        {
            get
            {
                return m_mapper.BigRadius;
            }
            set
            {
                m_mapper.BigRadius = value;
            }
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double SmallRadius
        {
            get
            {
                return m_mapper.SmallRadius;
            }
            set
            {
                m_mapper.SmallRadius = value;
            }
        }
    }
}